This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
Use non-Admin API to query VMs wherever possible #774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If possible do not use the Admin API:
In the query_vm_by_name method use the non-Admin API
I was tempted just to create a new method called query_vm_by_name_not_as_admin but decided that wasn't necessary: I think this fine, both the Admin and non-Admin query return an XML object with a 'href' which is what we care about:
As per https://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/QueryResultVMRecordType.html and https://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/QueryResultAdminVMRecordType.html both return something with a href
@shashim22 added this method last summer in https://github.com/vmware/pyvcloud/pull/367/files so should definitely review, :-)
This change is